<HTML><HEAD><TITLE>breal(+Number, -Result)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Arithmetic</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>breal(+Number, -Result)</H1>
Converts Number into a breal number and unifies it with Result.
<DL>
<DT><EM>Number</EM></DT>
<DD>A number.
</DD>
<DT><EM>Result</EM></DT>
<DD>A variable or bounded real number.
</DD>
</DL>
<H2>Description</H2>
    This predicate is used by the ECLiPSe compiler to expand evaluable
    arithmetic expressions.  So the call to breal(Number, Result) is
    equivalent to
<PRE>
    Result is breal(Number)
</PRE>
    which should be preferred.

<H3>Modes and Determinism</H3><UL>
<LI>breal(+, -) is det
</UL>
<H3>Exceptions</H3>
<DL>
<DT><EM>(4) instantiation fault </EM>
<DD>Number is not instantiated (non-coroutining mode only).
<DT><EM>(24) number expected </EM>
<DD>Number is not of a numeric type.
</DL>
<H2>Examples</H2>
<PRE>
Success:
    ?- breal(25, X).
    X = 25.0__25.0

    ?- breal(1.5, X).
    X = 1.5__1.5

    ?- breal(3_4, X).
    X = 0.74999999999999989__0.75000000000000011

    ?- breal(1.0__1.01, X).
    X = 1.0__1.01

Fail:
    ?- breal(1.0, 0.9__1.1).
    No (0.00s cpu)

    ?- breal(3, 3).
    No (0.00s cpu)

    ?- breal(1, r).
    No (0.00s cpu)

Error:
    ?- breal(A, X).
    instantiation fault in breal(A, X)

    ?- breal(4 + 2, X).
    number expected in breal(4 + 2, X)
</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/arithmetic/integer-2.html">integer / 2</A>, <A HREF="../../kernel/arithmetic/float-2.html">float / 2</A>, <A HREF="../../kernel/arithmetic/rational-2.html">rational / 2</A>, <A HREF="../../kernel/arithmetic/is-2.html">is / 2</A>, <A HREF="../../kernel/arithmetic/breal_min-2.html">breal_min / 2</A>, <A HREF="../../kernel/arithmetic/breal_max-2.html">breal_max / 2</A>, <A HREF="../../kernel/arithmetic/breal_bounds-3.html">breal_bounds / 3</A>, <A HREF="../../kernel/arithmetic/breal_from_bounds-3.html">breal_from_bounds / 3</A>, <A HREF="../../kernel/typetest/breal-1.html">breal / 1</A>
</BODY></HTML>
